package Homework;

import java.util.Arrays;
import java.util.Random;

public class homework11 {
	public static void main(String[] args) {
		int[] arr=new int[6];
		RanAddList(arr,6);
		System.out.println(Arrays.toString(arr));
	}

	private static int[] RanAddList(int[] arr, int num){
		Random r=new Random();
		int flag=0;
		int index=0;
		for(int i=0;i<num;i++){
			int rannum=r.nextInt(100);
			for(int j=0;j<arr.length;j++){
				if(rannum==arr[j]){
					flag=1;
				}
			}
			if(flag!=1){
				arr[index]=rannum;
				index++;
			}
		}
		return arr;
	}
}
